import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: HomeApp(),
    debugShowCheckedModeBanner: false,
  ));
}

class HomeApp extends StatelessWidget {
  const HomeApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Container 组件的使用'),
        leading: Icon(Icons.menu),
        backgroundColor: Colors.orange,
      ),
      body: BodyApp(),
      bottomNavigationBar: BottomNavigationBar(items: [
        BottomNavigationBarItem(
            icon: Icon(Icons.home), label: '首页', backgroundColor: Colors.red),
        BottomNavigationBarItem(
            icon: Icon(Icons.search), label: '搜索', backgroundColor: Colors.red),
        BottomNavigationBarItem(
            icon: Icon(Icons.person), label: '我的', backgroundColor: Colors.red)
      ]),
    );
  }
}

class BodyApp extends StatelessWidget {
  const BodyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 300,
      height: 600,
      padding: EdgeInsets.all(30),
      margin: EdgeInsets.all(15),
      decoration: BoxDecoration(
          color: Colors.orange,
          border: Border.all(width: 5, color: Colors.red),
          borderRadius: BorderRadius.only(
              topLeft: Radius.circular(20), bottomRight: Radius.circular(20))),
      child: Container(
          color: Colors.yellow,
          child: Center(
            child: Text(
              'Hello World',
              style: TextStyle(
                  fontSize: 30, fontWeight: FontWeight.bold, color: Colors.red),
            ),
          )),
    );
  }
}
